package com.neusoft.kora.refactor.sd;


import com.sun.media.jfxmediaimpl.platform.Platform;

/**
 * <p/>com.neusoft.kora.refactor.sd
 * <p/>Restructure
 * <p/>Created by chenxiangning on 15-11-9.
 */
public class IntroduceExplainingVariable {


    void demo() {

        if (Platform.getPlatformInstance().toString().indexOf("MAC") > -1 &&
                (Deprecated.class.getName().toString().toLowerCase().indexOf("Ie") > -1)
                && WasInitalized()) {

            //do something

        }
    }
    //------------------------------------------------------------------

    void demo_() {
        //...
        boolean mac = Platform.getPlatformInstance().toString().indexOf("MAC") > -1;
        //...
        boolean ie = (Deprecated.class.getName().toString().toLowerCase().indexOf("Ie") > -1);
        boolean wasInitalized = WasInitalized();

        if (mac && ie && wasInitalized) {

            //do something

        }
    }


    private boolean WasInitalized() {
        return false;
    }


    //-------------------------------------------------

    void demo2() {
        if ((System.getProperty("Windows").equals("xxx.windows")) &&
                (System.getProperty("IE").equals("xxx.IE"))) {
            //do something
        }
    }

    void demo2_() {
        boolean isWindowsOS = System.getProperty("Windows").equals("xxx.windows");
        boolean isIEBrowser = System.getProperty("IE").equals("xxx.IE");
        if (isWindowsOS && isIEBrowser) {
            //do something
        }
    }


}
